/**
 * Created by Administrator on 2017/5/6.
 */
"use strict";
swan_pc
    .controller("InvestmentListController",function($scope,investment,$rootScope){
        $scope.width7=((document.body.clientWidth-60)/12*10-35)/7;
        $scope.loadList = function(){
            $scope.investmentOppList = [];
            investment.query({id:$rootScope.presentAccountInfo.id},function(result){
                $scope.investmentOppList = result;
                console.log(result);
            })
        };
        $scope.loadList();

        $scope.returnStatusName = function(option){
            var name = "";
            _.forEach($scope.statusList,function(data){
                if(option == data.value){
                    name = data.name;
                }
            });
            return name;
        };
        $scope.returnOriginName = function(option){
            var name = "";
            _.forEach($scope.originList,function(data){
                if(option == data.value){
                    name = data.name;
                }
            });
            return name;
        };
        $scope.returnOddsName = function(option){
            var name = "";
            _.forEach($scope.oddsList,function(data){
                if(option == data.value){
                    name = data.name;
                }
            });
            return name;
        };

        $scope.statusList=[
            {
                name:'跟进线索',
                value:1
            },
            {
                name:'跟进机会',
                value:2
            },
            {
                name:'失败',
                value:3
            },
            {
                name:'没有需求',
                value:4
            },
            {
                name:'取消',
                value:5
            },
            {
                name:'赢得',
                value:6
            },
            {
                name:'收款完成',
                value:7
            },
            {
                name:'服务完毕',
                value:8
            },
        ];
        $scope.originList=[
            {
                name:'互联网广告',
                value:1
            },
            {
                name:'官网',
                value:2
            },
            {
                name:'800官方电话',
                value:3
            },
            {
                name:'R&R',
                value:4
            },
            {
                name:'传统广告',
                value:5
            },
            {
                name:'合作伙伴',
                value:6
            },
            {
                name:'战略客户',
                value:7
            },
            {
                name:'员工推荐',
                value:8
            },
            {
                name:'推广活动',
                value:9
            },
            {
                name:'市场活动',
                value:10
            },
            {
                name:'walk in',
                value:11
            },
            {
                name:'Coverage',
                value:12
            },
        ];
        $scope.typeList=[
            {
                name:'入驻招商管理',
                value:1
            },
            {
                name:'展览招商管理',
                value:2
            }
        ];
        $scope.identityList=[
            {
                name:'关键人',
                value:1
            },
            {
                name:'联系人',
                value:2
            },
        ];
        $scope.oddsList = [
            {
                name:"早期机会",
                value:1
            },
            {
                name:"可能赢得",
                value:2
            },
            {
                name:"预计赢得",
                value:3
            },
            {
                name:"必须赢得",
                value:4
            }
        ]


    });